package com.xungou.sender.service.impl;

import com.xungou.core.mvc.AbstractService;
import com.xungou.core.mvc.IDao;
import com.xungou.receiver.dao.IReceiver;
import com.xungou.receiver.pojo.Receiver;
import com.xungou.sender.dao.ISender;
import com.xungou.sender.pojo.Sender;
import com.xungou.sender.service.ISenderService;
import com.xungou.shop.service.IShopService;
import com.xungou.utils.UserUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service("senderService")
public class SenderServiceImpl extends AbstractService<Sender> implements ISenderService {
    @Resource  
    private ISender iSender;
    @Resource
    private IShopService shopService;

    @Override
    protected IDao<Sender> getDao() {
        return iSender;
    }

    @Override
    public List<Sender> list(Map<String, Object> params) {
        params.put("shopId", shopService.getShopByUserId(UserUtil.getCurrentUser().getId()).getId());
        return iSender.list(params);
    }
}